<include file="public/header_m"/>
<div class="am-cf admin-main">
    <include file="public/sidebar_m"/>
    <!-- content start -->
    <div class="admin-content">
        <div class="am-cf am-padding">
            <div class="am-fl am-cf"><strong class="am-text-primary am-text-lg">编辑预约记录</strong>
            </div>
        </div>
        <div class="am-tabs am-margin" data-am-tabs>
            <div class="am-tabs-bd">
                <div class="am-tab-panel am-fade am-in am-active" id="tab1">
                    <form class="am-form" name="form1" action="__URL__/yuyueEdit2" method="post" onsubmit="return checkForm()">
                        <div class="am-g am-margin-top">
                            <div class="am-u-sm-2 am-text-right">
                                手机
                            </div>
                            <div class="am-u-sm-10 am-u-end">
                                <input type="text" class="am-input-sm" name="phone" value="{$data.phone}">
                            </div>
                        </div>
                        <div class="am-g am-margin-top">
                            <div class="am-u-sm-2 am-text-right">
                                地址
                            </div>
                            <div class="am-u-sm-10 am-u-end">
                                <input type="text" class="am-input-sm" name="addr" value="{$data.addr}">
                            </div>
                        </div>
                        <div class="am-g am-margin-top">
                            <div class="am-u-sm-2 am-text-right">
                                日期
                            </div>
                            <div class="am-u-sm-10 am-u-end">
                                <input type="text" class="am-form-field am-input-sm" name="yuyue_date" value="{$data.yuyue_date}" onclick="laydate()">
                            </div>
                        </div>
                        <div class="am-g am-margin-top">
                            <div class="am-u-sm-2 am-text-right">
                                姓名
                            </div>
                            <div class="am-u-sm-10 am-u-end">
                                <input type="text" class="am-input-sm" name="xin" value="{$data.xin}">
                            </div>
                        </div>
                        <div class="am-g am-margin-top">
                            <div class="am-u-sm-2 am-text-right">
                                预约
                            </div>
                            <div class="am-u-sm-10 am-u-end">
                                <select id="yuyue" name="yuyue">
                                    <option value="{$data.yuyue}">{$data.yuyue}</option>
                                    <option value="9:00~10:00">9:00~10:00</option>
                                    <option value="10:00~11:00">10:00~11:00</option>
                                    <option value="11:00~12:00">11:00~12:00</option>
                                    <option value="12:00~13:00">12:00~13:00</option>
                                    <option value="13:00~14:00">13:00~14:00</option>
                                    <option value="14:00~15:00">14:00~15:00</option>
                                    <option value="15:00~16:00">15:00~16:00</option>
                                    <option value="16:00~17:00">16:00~17:00</option>
                                    <option value="17:00~18:00">17:00~18:00</option>
                                    <option value="18:00~19:00">18:00~19:00</option>
                                    <option value="19:00~20:00">19:00~20:00</option>
                                </select>
                            </div>
                        </div>
                        <div class="am-g am-margin-top">
                            <div class="am-u-sm-2 am-text-right">
                                销售员
                            </div>
                            <div class="am-u-sm-10 am-u-end">
                                <select name="sale" id="sale">
                                    <option value="">--请选择--</option>
                                    <foreach name="datas" item="l">
                                        <option value="{$l.name}">{$l.name}</option>
                                    </foreach>
                                </select>
                            </div>
                        </div>
                        <div class="am-g am-margin-top">
                            <div class="am-u-sm-2 am-text-right">
                                备注
                            </div>
                            <div class="am-u-sm-10 am-u-end">
                                <textarea class="" rows="5" id="descr" name="descr">{$data.descr}</textarea>
                            </div>
                        </div>
                        <input type="hidden" name="id" value="{$data.id}"/>
                        <input type="hidden" name="uid" value="{$uid}"/>
                        <div class="am-g am-margin">
                            <input type="submit" name="" value="修改" class="am-btn am-btn-primary am-btn-sm am-fl">
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
    <!-- content end -->

</div>
<script>
    function checkForm() {
        var addform = document.form1;
        var reg = /^0?1[3|4|5|8][0-9]\d{8}$/;
        if (addform.phone.value == "") {
            alert("请填写手机!");
            addform.tel.focus();   //用户名输入框获得焦点
            return false;   //不提交表单
        }
        else if (isNaN(addform.phone.value)) {
            alert("电话只能为数字!");
            addform.phone.focus();   //用户名输入框获得焦点
            return false;   //不提交表单
        }
        else if (addform.phone.value.length != 11) {
            alert("手机号为11个数字!");
            addform.phone.focus();   //用户名输入框获得焦点
            return false;   //不提交表单
        } else if (!reg.test(addform.phone.value)) {
            alert("请输入正确的手机号！");
            addform.phone.focus();
            return false;
        }
        return true;
    }
</script>
<include file="public/footer_m"/>
